<template>
  <div class="section-body">
    <div class="coupon-box" v-show="styleType == 1">
      <div
        class="coupon-content"
        :class="index == 2? 'no-margin-right' : '' "
        v-for="(item, index) in 3"
        :key="index"
        :style="{ backgroundImage: `url(${propsData.params.couponPic})` }"
      >
        <div
          class="price"
          :style="{ color: propsData.params.colorConfig.priceColor }"
        >
          <span>¥</span>
          <span>&nbsp;99</span>
        </div>
        <div
          class="info"
          :style="{ color: propsData.params.colorConfig.infoColor }"
        >
          2021.8.9到期
        </div>
        <div class="receive">
          <span :style="{ color: propsData.params.colorConfig.btnColor }"
            >立即领取</span
          >
        </div>
      </div>
    </div>

    <div class="style-two" v-show="styleType == 2">
      <div class="coupon-content" v-for="(item, index) in 3" :key="index">
        <div
          class="content-bg"
          :style="{ background: propsData.params.colorConfig.bgColor }"
        >
          <div class="left-circle"></div>
          <div class="right-circle"></div>
          <div
            class="dashed-line"
            :style="{ borderColor: propsData.params.colorConfig.breakLine }"
          ></div>
        </div>
        <div class="content-box">
          <div
            class="price"
            :style="{ color: propsData.params.colorConfig.priceColor }"
          >
            <span>¥</span>
            <span>&nbsp;99</span>
          </div>
          <div
            class="info"
            :style="{ color: propsData.params.colorConfig.infoColor }"
          >
            2021.8.9到期
          </div>
          <div class="receive">
            <span :style="{ color: propsData.params.colorConfig.btnColor }"
              >立即领取</span
            >
          </div>
        </div>
      </div>
    </div>

    <div class="style-three" v-show="styleType == 3">
      <div class="coupon-content" v-for="(item, index) in 3" :key="index">
        <div
          class="content-bg"
          :style="{ background: propsData.params.colorConfig.bgColor }"
        ></div>
        <div class="content-box">
          <div
            class="price"
            :style="{ color: propsData.params.colorConfig.priceColor }"
          >
            <span>¥</span>
            <span>&nbsp;99</span>
          </div>
          <div
            class="info"
            :style="{ color: propsData.params.colorConfig.infoColor }"
          >
            2021.8.9到期
          </div>
          <div class="hold-line"></div>
          <div class="receive">
            <span :style="{ color: propsData.params.colorConfig.btnColor }"
              >立即领取</span
            >
          </div>
          <div class="left-circle"></div>
          <div
            class="right-circle"
            :style="{ background: propsData.params.colorConfig.bgColor }"
          ></div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "",
  props: {
    propsData: {
      type: Object,
      default: {},
    },
  },
  data() {
    return {};
  },
  mounted() {},
  watch: {},
  computed: {
    styleType() {
      return this.propsData.params.styleType || "1";
    },
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.section-body {
  .coupon-box {
    width: 100%;
    height: 122px;
    display: flex;
    align-items: center;
    margin: 0 auto;
    .coupon-content {
      width: 109px;
      height: 122px;
      padding-top: 11px;
      text-align: center;
      margin-right: 12px;
      background-size: 100% 100%;
      background-repeat: no-repeat;
      .price {
        font-size: 30px;
        font-weight: bold;
        color: #ec2827;
        display: flex;
        align-items: baseline;
        line-height: 1;
        justify-content: center;
        span:first-child {
          font-size: 16px;
        }
      }
      .info {
        font-size: 11px;
        line-height: 20px;
        color: #484a51;
        margin-top: 10px;
      }
      .receive {
        width: 74px;
        height: 20px;
        background: linear-gradient(180deg, #ffeecf 0%, #fed59b 100%);
        border-radius: 14px;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 23px auto;
        span {
          font-size: 12px;
          font-weight: 400;
          color: #ec2827;
        }
      }
    }
    .no-margin-right{
      margin-right: 0;
    }
  }
  .style-two {
    width: 100%;
    height: 122px;
    display: flex;
    align-items: center;
    .coupon-content {
      width: 109px;
      height: 122px;
      position: relative;
      margin-right: 12px;
      .content-bg {
        width: 100%;
        height: 100%;
        background: linear-gradient(180deg, #ffb85c 0%, #ff7734 100%);
        border-radius: 10px;
        position: relative;
        .left-circle {
          width: 12px;
          height: 12px;
          background: #ffffff;
          border-radius: 50%;
          left: -6px;
          top: 86px;
          position: absolute;
          display: none;
        }
        .right-circle {
          width: 12px;
          height: 12px;
          background: #ffffff;
          border-radius: 50%;
          right: -6px;
          top: 86px;
          position: absolute;
          display: none;
        }
        .dashed-line {
          width: 91px;
          border: 0.5px dashed #e87531;
          position: absolute;
          left: 9px;
          top: 92px;
        }
      }
      .content-box {
        width: 100%;
        height: 100%;
        position: absolute;
        left: 0;
        top: 0;
        z-index: 11;
        text-align: center;
        .price {
          font-size: 30px;
          font-weight: bold;
          color: #ec2827;
          display: flex;
          align-items: baseline;
          line-height: 1;
          justify-content: center;
          font-family: PingFang SC;
          margin-top: 10px;
          span:first-child {
            font-size: 16px;
          }
        }
        .info {
          font-size: 11px;
          margin-top: 15px;
          line-height: 20px;
          color: #ffffff;
        }
        .receive {
          width: 100%;
          height: 20px;
          display: flex;
          justify-content: center;
          align-items: center;
          margin-top: 23px;
          span {
            font-size: 14px;
            font-family: PingFang SC;
            font-weight: 400;
            line-height: 14px;
            color: #ffffff;
          }
        }
      }
    }
    .coupon-content:last-child {
      margin-right: 0;
    }
  }
  .style-three {
    width: 100%;
    height: 122px;
    display: flex;
    align-items: center;
    .coupon-content {
      width: 109px;
      height: 122px;
      position: relative;
      margin-right: 12px;
      padding-top: 7px;
      .content-bg {
        width: 93.58%;
        height: 115px;
        background: #ffcb3f;
        margin-left: 7px;
      }
      .content-box {
        width: 93.58%;
        height: 116px;
        background: #ffffff;
        border: 0.5px solid #666666;
        position: absolute;
        left: 0;
        top: 0;
        z-index: 11;
        display: flex;
        flex-direction: column;
        align-items: center;
        .price {
          font-size: 30px;
          font-weight: bold;
          color: #ffcb3f;
          display: flex;
          align-items: baseline;
          line-height: 1;
          justify-content: center;
          font-family: PingFang SC;
          margin-top: 14px;
          span:first-child {
            font-size: 16px;
          }
        }
        .info {
          font-size: 11px;
          margin-top: 5px;
          line-height: 20px;
          color: #404040;
        }
        .hold-line {
          width: 21px;
          border: 1px solid #cccccc;
          margin-top: 4px;
        }
        .receive {
          width: 100%;
          height: 20px;
          display: flex;
          justify-content: center;
          align-items: center;
          margin-top: 11px;
          span {
            font-size: 14px;
            font-family: PingFang SC;
            font-weight: 400;
            line-height: 14px;
            color: #404040;
          }
        }
        .left-circle {
          width: 12px;
          height: 12px;
          background: #ffffff;
          border-radius: 50%;
          left: -6px;
          top: 63px;
          border-right: 1px solid #666666;
          position: absolute;
          display: none;
        }
        .right-circle {
          width: 12px;
          height: 12px;
          background: #ffcb3f;
          border-radius: 50%;
          right: -6px;
          top: 63px;
          border-left: 1px solid #666666;
          position: absolute;
          display: none;
        }
      }
    }
    .coupon-content:last-child {
      margin-right: 0;
    }
  }
}
</style>
